library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity fiftyHz is
generic (N1:integer:=1000000;
		M1:integer:=120000);
port (
		clk:in std_logic;
		outp:out std_logic
		);
end entity;

architecture a of fiftyHz is
	signal temp:integer range N1 downto 0;
begin
process (clk,temp)
begin
	if rising_edge(clk) then
	if temp=N1-1 then temp<=0;
	else temp<=temp+1;
	end if;
	end if;
end process;
outp<='1' when temp<M1 else '0';
end a;
--According to my test (based on the second servo motor from top),
--26000/1000000 will be the perfect value for one side and 120000/100000 for the other side.